package com.sright.bcard.content.dal.dao.impl;

import com.sright.bcard.common.service.share.base.dao.BaseDAOImpl;
import com.sright.bcard.common.service.share.base.dao.BaseMapper;
import com.sright.bcard.common.service.share.dto.page.BetweenDateParamRequest;
import com.sright.bcard.common.service.share.dto.page.PageParamRequest;
import com.sright.bcard.content.dal.dao.CardUserInfoDAO;
import com.sright.bcard.content.dal.entity.CardUserInfoDO;
import com.sright.bcard.content.dal.mapper.CardUserInfoDOMapper;
import com.sright.bcard.content.dal.result.UserDetailResult;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

@Repository
public class CardUserInfoDAOImpl extends BaseDAOImpl<CardUserInfoDO> implements CardUserInfoDAO {

    @Resource
    private CardUserInfoDOMapper cardUserInfoDOMapper;

    @Override
    protected BaseMapper<CardUserInfoDO> getObjMapper() {
        return cardUserInfoDOMapper;
    }

    @Override
    public List<CardUserInfoDO> selectByUserId(Long userId) {
        return cardUserInfoDOMapper.selectByUserId(userId);
    }

    @Override
    public Integer countOfCardUserInfo(Integer checkStatus, BetweenDateParamRequest betweenDateParamRequest) {
        return cardUserInfoDOMapper.countOfCardUserInfo(checkStatus, betweenDateParamRequest);
    }

    @Override
    public List<CardUserInfoDO> selectOfCardUserInfo(Integer checkStatus, BetweenDateParamRequest betweenDateParamRequest, PageParamRequest pageParamRequest) {
        return cardUserInfoDOMapper.selectOfCardUserInfo(checkStatus, betweenDateParamRequest, pageParamRequest);
    }


    @Override
    public CardUserInfoDO selectOneByUserId(Long userId) {
        return cardUserInfoDOMapper.selectOneByUserId(userId);
    }

    @Override
    public UserDetailResult userDetail(Long id) {
        return cardUserInfoDOMapper.userDetail(id);
    }
}
